home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / etc / bash_completion.d / cowsay < prev    next >
Text File  |  2009-04-02  |  534b  |  27 lines

  1. # -*- mode: shell-script; sh-basic-offset: 8; indent-tabs-mode: t -*-
  2. # ex: ts=8 sw=8 noet filetype=sh
  3. #
  4. # bash completion for cowsay
  5.  
  6. have cowsay &&
  7. _cowsay()
  8. {
  9.     local cur prev
  10.  
  11.     COMPREPLY=()
  12.     cur=`_get_cword`
  13.     prev=${COMP_WORDS[COMP_CWORD-1]}
  14.  
  15.     case $prev in
  16.         -f)
  17.             COMPREPLY=( $( cowsay -l | tail -n +2 | tr " " "\n" | grep "^$cur" ) )
  18.             return 0
  19.             ;;
  20.     esac
  21.  
  22.     # relevant options completion
  23.     COMPREPLY=( $( compgen -W '-b -d -g -p -s -t -w -y -e -f -h -l -n -T -W' -- $cur ) )
  24.  
  25. } &&
  26. complete -F _cowsay $default cowsay cowthink
  27.